import sys


if len(sys.argv) != 2:
	print "%s rpt_file"%(sys.argv[0])
	sys.exit(1)

fname = sys.argv[1]
# fname = "ucpu_interface_delay.rpt"

with open(fname) as f:
	for line in f:
		line = line.strip()
		sp = line.split()
		if len(sp) != 6:
			continue

		if sp[4].endswith("/D"):
			# fetch input
			s = "input: "
			s += sp[2].lstrip("unoncpu/")
			s += " " + sp[5]
			print s
		elif sp[2].endswith("/CP"):
			#fetch output
			s = "output: "
			s += sp[4].lstrip("unoncpu/")
			s += " " + sp[5]
			print s


